/* 
* This module is part of the Entertainment Network system 
* Copyright (c) SCC Soft Computer, Inc. 2018 
* All Rights Reserved 
* 
* This document contains unpublished, confidential and proprietary 
* information of SCC Soft Computer, Inc. No disclosure or use of 
* any portion of the contents of these materials may be made without the 
* express written consent of Soft Computer Consultants, Inc. 
* 
*/ 

package isd.dp.ua.EntertainmentNetworkServer.Models;
// Generated Mar 14, 2018 11:11:06 AM by Hibernate Tools 3.6.0.Final

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

import isd.dp.ua.EntertainmentNetworkServer.Common.BaseModel;

/**
 * Orders generated by hbm2java
 */
@SuppressWarnings("serial")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType
@Entity
@Table(name = "ORDERS", schema = "PBAB")
public class Orders extends BaseModel  implements java.io.Serializable 
{
	private BigDecimal ordId;
	private Date ordDate;
	private String ordComm;
	private BigDecimal ordCost;
	private Set<Tickets> ticketses = new HashSet<Tickets>(0);

	public Orders() {
	}

	public Orders(BigDecimal ordId, Date ordDate, BigDecimal ordCost) 
	{
		this.ordId = ordId;
		this.ordDate = ordDate;
		this.ordCost = ordCost;
	}

	public Orders(BigDecimal ordId, Date ordDate, String ordComm, BigDecimal ordCost, Set<Tickets> ticketses)
	{
		this.ordId = ordId;
		this.ordDate = ordDate;
		this.ordComm = ordComm;
		this.ordCost = ordCost;
		this.ticketses = ticketses;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ORD_SEQ")
    @SequenceGenerator(name = "ORD_SEQ", sequenceName = "ORD_SEQ")
	@Column(name = "ORD_ID", unique = true, nullable = false, precision = 22, scale = 0)
	public BigDecimal getOrdId() 
	{
		return this.ordId;
	}

	public void setOrdId(BigDecimal ordId) 
	{
		this.ordId = ordId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ORD_DATE", nullable = false, length = 7, insertable = false)
	public Date getOrdDate() 
	{
		return this.ordDate;
	}

	public void setOrdDate(Date ordDate) 
	{
		this.ordDate = ordDate;
	}

	@Column(name = "ORD_COMM")
	public String getOrdComm() 
	{
		return this.ordComm;
	}

	public void setOrdComm(String ordComm) 
	{
		this.ordComm = ordComm;
	}

	@Column(name = "ORD_COST", nullable = false, precision = 22, scale = 0)
	public BigDecimal getOrdCost() 
	{
		return this.ordCost;
	}

	public void setOrdCost(BigDecimal ordCost) 
	{
		this.ordCost = ordCost;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "orders")
	public Set<Tickets> getTicketses() 
	{
		return this.ticketses;
	}

	public void setTicketses(Set<Tickets> ticketses) 
	{
		this.ticketses = ticketses;
	}
	
	@Override
	public String toString()
	{
		return "Order [ordId=" + this.getOrdId() + "]";
	}
}
